﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Research.Kinect.Nui;
using Coding4Fun.Kinect.Wpf;
using Blake.NUI.WPF.Utility;
using Kinductor.Gestures;
using Kinductor.Midi;
using System.Windows.Threading;

using Kinductor.ViewModels;

namespace Kinductor
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            this.Closed += new EventHandler(MainWindow_Closed);
            this.TextInput += new TextCompositionEventHandler(MainWindow_TextInput);
            this.KeyDown += new KeyEventHandler(MainWindow_KeyDown);
        }

        void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Space)
            {
                main.TogglePlay();
            }
        }

        void MainWindow_TextInput(object sender, TextCompositionEventArgs e)
        {
            
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            main.Init();
        }

        void MainWindow_Closed(object sender, EventArgs e)
        {
            main.Unload();
        }
    }
}
